package org.gd.hellojson.gson;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

public enum SessionFromProminMessages implements SessionFromProminMessagesInterface {

    SID_NOT_SET(1, "", ""),
    EKB_ID_NOT_SET(2, "", ""),
    CRF_NOT_SET(3, "", ""),
    LDAP_NOT_SET(4, "", ""),
    LDAP_CHECKER_FAIL(5, "", ""),
    USER_NOT_FOUND(6, "", ""),
    FAIL_SET_USER_TO_SESSION(7, "", ""),

    SUCCESS();

    private Integer code;
    private String tile;
    private String message;

    private SessionFromProminMessages() {
        this.code = 0;
        this.tile = "";
        this.message = "";
    }

    private SessionFromProminMessages(Integer code, String tile, String message) {
        this.code = code;
        this.tile = tile;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getTile() {
        return tile;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("code", getCode());
        jsonObject.addProperty("tile", getTile());
        jsonObject.addProperty("message", getMessage());
        return new Gson().toJson(jsonObject);
    }
}
